//
//  main.m
//  oc_15
//
//  Created by 楼楚 on 15/9/14.
//  Copyright (c) 2015年 Chu Lou. All rights reserved.
//

#import <Foundation/Foundation.h>

int main(int argc, const char * argv[]) {
    @autoreleasepool {
       
        NSIndexSet *indexSet = [[NSIndexSet alloc]initWithIndex:1];
        NSIndexSet *indexSet1 = [[NSIndexSet alloc]initWithIndexSet:indexSet];
        NSLog(@"%@,%@",indexSet,indexSet1);
        NSIndexSet *indexSet2 = [[NSIndexSet alloc]initWithIndexesInRange:NSMakeRange(2,3)];
        NSLog(@"%@",indexSet2);
        NSArray *arr = @[@"one",@"two",@"three",@"four",@"five",@"six"];
        NSArray *newArr = [arr objectsAtIndexes:indexSet2 ];
        NSLog(@"%@",newArr);
        
        NSMutableIndexSet *mSet = [[NSMutableIndexSet alloc]init];
        [mSet addIndex:0];
        [mSet addIndex:3];
        [mSet addIndex:4];
        NSArray *newArr1 = [arr objectsAtIndexes:mSet];
        NSLog(@"%@",newArr1);
                           
        
    
    
    }
    return 0;
}
